﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>收款清单</title>
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/shop.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/shopSelecterNew.js"></script>
<script type="text/javascript" src="../js/find.js"></script>
<script type="text/javascript" src="../js/pagination.js"></script>
<script type="text/javascript" src="../js/doubleDate2.0.js"></script> 
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.moreData{width:100%;overflow-x:scroll;}
.member_list th{white-space:nowrap;}
</style>
<script type="text/javascript">
$(function(){
	$("#shopIsChoosed").click(function(){
		if($("#shopIsChoosed").is(":checked")){
			$("#shopName").attr("disabled",false);
			
		}else{
			$("#shopName").attr("disabled",true);
		}
	});
	$('#dtBegin').val(getToday());
	 $('#dtEnd').val(getToday());
	 refreshInput($(".serWrapper"));
		$('.doubledate').kuiDate({
			className:'doubledate',
			isDisabled: "0"  // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
		});
})

var pageIndex = 1
function search(index){
	if(IsNotEmpty(index)){
	pageIndex = index	
	}else{
		pageIndex = 1;
	}
	var mp=$("#mp").val().replace(/\s/gi,'');	
	var cardNo=$("#cardNo").val().replace(/\s/gi,'');
	var dtBegin=$("#dtBegin").val();
	var dtEnd=$("#dtEnd").val();
	var billNo=$("#billNo").val();
	var standNo=$("#standNo").val();
	var custName=$("#custName").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){		
		shopId=$("#shopName").val();
		if(IsEmpty(shopId)){
			shopId = "";
		}
	}
	
	var params = {'mp':mp,'cardNo':cardNo,'dtBegin':dtBegin,'dtEnd':dtEnd,'billNo':billNo,'standNo':standNo,'custName':custName,'shopId':shopId}
	
	var dt = _findInfo("../saleBill/find/allRecord/"+(pageIndex-1)+"/10", params)
	if(IsNotEmpty(dt)&&dt.state==0){
/* 		var p = new Array(cl","ls","FactAmt","FreeAmt","BankAmt","CashAmt","CashCouponAmt","DepositAmt","DepositAmt","VoucherAmt","VoucherMemo","VoucherAmt2","VoucherMemo2","FreeAmt");
		_loadInfo(dt, "memberList", p); */
		$("#memberList tbody").empty()
		$("#sup").html("共"+dt.result.len+"条")
		for(var i=0;i<dt.result.data.length;i++){
			var status = _getIntOfJson(i, dt, "status");
			if(status ==4){
				
			var htm="<tr style=\"white-space: nowrap;color:red;\">"
			}else{
				
			var htm="<tr style=\"white-space: nowrap;\">"
			}
			
			htm+="<td>"+_getSomeOfJson(i, dt, "StandNo")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "SaleBillNo")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "ReciveDate")+"</td>"
			htm+="<td>"+_getSomeOfJson(i, dt, "scheduleTypeName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "RoomNo")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "CustomerName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "Mp")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "levelName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "MemberCardNo")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "gs")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "cl")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "ls")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "fj")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "bjw")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "FreeAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "FactAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "BankAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "checkAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "CashAmt")+"</td>"
				//htm+="<td>"+_getIntOfJson(i, dt, "lklAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "CashCouponAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "RegisteAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "DepositAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "IntegralAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "couponAmt")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "VoucherAmt")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "VoucherMemo")+"</td>"
				htm+="<td>"+_getIntOfJson(i, dt, "VoucherAmt2")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "VoucherMemo2")+"</td>"
				htm+="<td>"+(_getIntOfJson(i, dt, "VoucherAmt")+_getIntOfJson(i, dt, "VoucherAmt2"))+"</td>"
				htm+="<td>"+(_getIntOfJson(i, dt, "FactAmt")-_getIntOfJson(i, dt, "VoucherAmt2")-_getIntOfJson(i, dt, "VoucherAmt")).toFixed(2)+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "SaleUserName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "Memo")+"</td>"

				htm+="</tr>"
				$("#memberList tbody").append(htm)
		}
		
		_loadPage("pager", pageIndex, 10, dt, search, "NoResult")
	}
	var dt2 = _findInfo("../saleBill/find/allRecordSum", params)
	if(IsNotEmpty(dt2)&&dt2.state==0){
		var factAmt = _getIntOfJson(0, dt2, "factamt");
		var FreeAmt = _getIntOfJson(0, dt2, "FreeAmt");
		var CashAmt = _getIntOfJson(0, dt2, "CashAmt");
		var BankAmt = _getIntOfJson(0, dt2, "BankAmt");
		var CashCouponAmt = _getIntOfJson(0, dt2, "CashCouponAmt");
		var DepositAmt = _getIntOfJson(0, dt2, "DepositAmt");
		var VoucherAmt = _getIntOfJson(0, dt2, "VoucherAmt");
		var VoucherAmt2 = _getIntOfJson(0, dt2, "VoucherAmt2");
		var IntegralAmt = _getIntOfJson(0, dt2, "IntegralAmt");
		var gs = _getIntOfJson(0, dt2, "gs");
		var cl = _getIntOfJson(0, dt2, "cl");
		var ls = _getIntOfJson(0, dt2, "ls");
		var checkAmt = _getIntOfJson(0, dt2, "checkAmt");
		var couponAmt = _getIntOfJson(0, dt2, "couponAmt");
		var lklAmt = _getIntOfJson(0, dt2, "lklAmt");
		var htm="实收总计："+factAmt+"&nbsp;"+"其中："+"储值支付："+DepositAmt+"&nbsp;预收支付："+CashCouponAmt+"&nbsp;积分抵现："+IntegralAmt+"&nbsp;信用卡支付："+BankAmt+"&nbsp;支票支付："+checkAmt+"&nbsp;拉卡拉："+lklAmt+"&nbsp;现金支付："
		+CashAmt+"&nbsp;工时抵减："+VoucherAmt+"&nbsp;备件抵减："+VoucherAmt2
		+"&优惠卷支付："+couponAmt
		$("#sum").html(htm)
	}

	
}

function toAdd(){
	var mp=$("#mp").val().replace(/\s/gi,'');	
	var cardNo=$("#cardNo").val().replace(/\s/gi,'');
	var dtBegin=$("#dtBegin").val();
	var dtEnd=$("#dtEnd").val();
	var billNo=$("#billNo").val();
	var standNo=$("#standNo").val();
	var custName=$("#custName").val();
	var shopId="";
	if($("#shopIsChoosed").is(":checked")){		
		shopId=$("#shopName").val();
		if(IsEmpty(shopId)){
			shopId = "";
		}
	}
	var params = {'mp':mp,'cardNo':cardNo,'dtBegin':dtBegin,'dtEnd':dtEnd,'billNo':billNo,'standNo':standNo,'custName':custName,'shopId':shopId,'downType':17}
	window.location.href="../csvdown/down/csv/down?"+$.param(params)
}
</script>
</head>

<body>
<div class="container" id="container">
  <div class="container_R fr">
	<div class="place">收款清单</div>
	<div class="member_search">
      <p><span>
        <input type="checkbox" id="shopIsChoosed" style="width:auto;height:auto;border:none;">
        店面：</span>
        <select disabled="disabled" id="shopName" onclick="openShopListPanel(this)" style=";height:20px;">
        </select>
        <span>起始日期：</span>
        <input type="text" readonly class="doubledate ipticon"  id="dtBegin"/>
        <span>截止时间：</span>
        <input type="text" readonly class="doubledate ipticon" id="dtEnd"/>
      </p>
      <p>
      <span>姓名：</span>
        <input type="text" id="custName" class="absoluteTxt">
      <span>手机号：</span>
      <input type="text" id="mp" class="absoluteTxt">
        <span>会员卡号：</span>
        <input type="text" id="cardNo" class="absoluteTxt">
      </p>
      <p>
        <span>单号：</span>
        <input type="text" id="billNo" class="absoluteTxt">
         <span>工单号：</span>
        <input type="text" id="standNo" class="absoluteTxt">
            <input type="button" value="查询" class="btn" onclick="search(1)">
      
      </p>
    </div>
	
    <div class="moreData">
    <table class="member_list" cellpadding="0" cellspacing="1" border="0" id="memberList" style="margin-top:45px;position:relative;">
    	<caption class="fixedTit"><strong>收款清单列表        <span id="sup">共0条</span></strong><input type="button" value="导出" class="common_btn addList" onclick="toAdd()"></caption>
    	<thead>
    	<tr style="white-space: nowrap;">
        	<th style="width: 60px;">工单号</th>
        	<th style="width: 60px;">单号</th>
        	<th>时间</th>
        	<th>服务项目</th>
        	<th>车牌号</th>
        	<th>客户姓名</th>
        	<th>电话</th>
        	<th>会员级别</th>
        	<th>会员卡号</th>
        	<th>工时</th>
        	<th>备件</th>
        	<th>零售</th>
        	<th>附加</th>
        	<th>保费</th>
        	<th>免单</th>
        	<th>实缴合计</th>
        	<th>信用卡支付</th>
        	<th>支票支付</th>
        	<th>现金支付</th>
        <!-- 	<th>拉卡拉</th> -->
        	<th>预收支付</th>
        	<th>挂账</th>
        	<th>储值支付</th>
        	<th>积分抵现</th>
        	<th>优惠券支付</th>
        	<th>工时抵用券</th>
        	<th>工时抵用券类型</th>
        	<th>备件抵用券</th>
        	<th>备件抵用券类型</th>
        	<th>抵减合计</th>
        	<th>付款合计</th>
        	<th>收款人</th>
        	<th>备注</th>
        </tr>
        </thead>
        <tbody></tbody>
    </table>
    </div>
     <div id="sum" style="float: left;"></div>
    <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" style="float: right;"></div>
  </div>
  <div class="fc"></div>
</div>
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
$(".moreData").scroll(function(){
	if($(this).scrollLeft()+$(this).width()>=$(this).find("table").width())return;
	$(this).find(".fixedTit").css("left",$(this).scrollLeft())	
})
addMargin($(".hideDiv"))
clearThis("absoluteTxt");
</script>
</body>
</html>
"WebContent/html/temp.html"